Page({
  data: {
    locations: []
    
  },

  onLoad() {
    this.getLocations();
    
  },

  getLocations() {
    wx.request({
      url: 'http://localhost:8080/city/list', // 替换为实际的后端接口地址
      method: 'GET',
      success: (res) => {
        if (res.statusCode === 200) {
          console.log(res.data)
          this.setData({
            locations: res.data
          });
        }
      }
    });
  },
});